import request from '@/utils/request'

const prePath = '/customize'

//新增自定义表格
export function createCustomize(data) {
  return request({
    url: prePath,
    method: 'post',
    data,
  })
}
//获取自定义表格分页数据
export function getCustomizePage(params) {
  return request({
    url: prePath + '/page',
    method: 'get',
    params,
  })
}
export function getCustomizeAll(data) {
  return request({
    url: prePath + '/all',
    method: 'get',
    data,
  })
}
//获取配置项
export function customizeGetSetting(params) {
  return request({
    url: prePath + '/sys/getSetting',
    method: 'get',
    params,
  })
}
//获取配置项
export function customizeGetInitSetting(params) {
  return request({
    url: prePath + '/sys/getAnnotateSetting',
    method: 'get',
    params,
  })
}
//获取配置项
export function getCustomizeSysSettingList(params) {
  return request({
    url: prePath + '/detail/all',
    method: 'get',
    params,
  })
}

//获取自定义表格用户配置项
export function getCustomizeSetting(params) {
  return request({
    url: prePath + '/user/getSetting',
    method: 'get',
    params,
  })
}
//跟新自定义表格
export function updateCustomize(data) {
  return request({
    url: prePath + '/sys/update',
    method: 'post',
    data,
  })
}
export function updateUserCustomize(data) {
  return request({
    url: prePath + '/user/update',
    method: 'post',
    data,
  })
}
//获取自定义表格一条数据
export function getCustomizeById(id) {
  return request({
    url: prePath + '/' + id,
    method: 'get',
  })
}
//自定义表格删除
export function customizeDeletc(data) {
  return request({
    url: prePath,
    method: 'delete',
    data,
  })
}
export function getFieldCustomize(data) {
  return request({
    url: prePath + '/detail/getField',
    method: 'post',
    data,
  })
}
export function getCustomizeAdjustPage(params) {
  return request({
    url: prePath + '/adjust/page',
    method: 'get',
    params,
  })
}

export function adjustAllFieldCustomize(data) {
  return request({
    url: prePath + '/adjust/adjustAllField',
    method: 'post',
    data,
  })
}
export function customizeUserShare(data) {
  return request({
    url: prePath + '/user/share',
    method: 'post',
    data,
  })
}
